package db;

// Generated Mar 23, 2013 11:32:01 AM by Hibernate Tools 4.0.0

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;

/**
 * Hooldusteenus generated by hbm2java
 */
@Entity
@Table(name = "hooldusteenus", uniqueConstraints = @UniqueConstraint(columnNames = "nimi"))
public class Hooldusteenus implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int hooldusteenusId;
	private HooldusteenuseLiik hooldusteenuseLiik;
	private HooldusteenuseYhik hooldusteenuseYhik;
	private Tootaja tootaja;
	private String nimi;
	private String kirjeldus;
	private BigDecimal hind;
	private String sagedus;


	@Id
	@Generated(GenerationTime.NEVER)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "hooldusteenus_id", unique = true, nullable = false)
	public int getHooldusteenusId() {
		return this.hooldusteenusId;
	}

	public void setHooldusteenusId(int hooldusteenusId) {
		this.hooldusteenusId = hooldusteenusId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "hooldusteenuse_liik", nullable = false)
	public HooldusteenuseLiik getHooldusteenuseLiik() {
		return this.hooldusteenuseLiik;
	}

	public void setHooldusteenuseLiik(HooldusteenuseLiik hooldusteenuseLiik) {
		this.hooldusteenuseLiik = hooldusteenuseLiik;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "hooldusteenuse_yhik", nullable = false)
	public HooldusteenuseYhik getHooldusteenuseYhik() {
		return this.hooldusteenuseYhik;
	}

	public void setHooldusteenuseYhik(HooldusteenuseYhik hooldusteenuseYhik) {
		this.hooldusteenuseYhik = hooldusteenuseYhik;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "kinnitaja", nullable = false)
	public Tootaja getTootaja() {
		return this.tootaja;
	}

	public void setTootaja(Tootaja tootaja) {
		this.tootaja = tootaja;
	}

	@Column(name = "nimi", unique = true, nullable = false, length = 70)
	public String getNimi() {
		return this.nimi;
	}

	public void setNimi(String nimi) {
		this.nimi = nimi;
	}

	@Column(name = "kirjeldus")
	public String getKirjeldus() {
		return this.kirjeldus;
	}

	public void setKirjeldus(String kirjeldus) {
		this.kirjeldus = kirjeldus;
	}

	@Column(name = "hind", nullable = false, precision = 16)
	public BigDecimal getHind() {
		return this.hind;
	}

	public void setHind(BigDecimal hind) {
		this.hind = hind;
	}

	@Column(name = "sagedus", nullable = false, length = 60)
	public String getSagedus() {
		return this.sagedus;
	}

	public void setSagedus(String sagedus) {
		this.sagedus = sagedus;
	}
}
